#include <bits/stdc++.h>
using namespace std;
int a[200010],n,vis[200010];
int main(){
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<=n;i++){
		int p=-1,k=0;
		for(int j=1;j<=n;j++){
			if(vis[j]==0&&p!=a[j]){
				printf("%d ",j);
				vis[j]=1;
				p=a[j];
				k=1;
			}
		}
		if(k==0) return 0;
		printf("\n");
	}
return 0;
}
